package top.tresman.cxxcommon.entity;

import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

@Data
public class LoginUserDTO implements Serializable {
    @Serial
    private static final long serialVersionUID = 4327727495878874272L;
    private String token;
    private String tokenPrefix;
    private UserInfo user;

    @Data
    public static class UserInfo {
        private Integer id;

        /**
         * 手机号
         */
        private String mobile;

        /**
         * 姓名
         */
        private String name;

        /**
         * 启用禁用：1=启用，0=禁用
         */
        private Boolean isEnable;

        /**
         * 上次登录角色id
         */
        private Integer lastRoleId;

        /**
         * 上次登录子角色id
         */
        private Integer lastSubRoleId;

        /**
         * 用户拥有的所有主角色id
         */
        private List<Integer> roleIdList;

        /**
         * 用户拥有的所有子角色id
         */
        private List<Integer> subRoleIdList;

        @JsonIgnore
        private RoleDTO currentRole;

        @JsonIgnore
        private List<RoleDTO> roleList;

        @JsonIgnore
        private List<RoleDTO> subRoleList;

        private LocalDateTime createdAt;

        private LocalDateTime updatedAt;

    }
}
